import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import mutations from './mutations'
import actions from './actions'
import A from './modules/A' 

Vue.use(Vuex)

export default new Vuex.Store({
  // state: {
  //   count:100
  // },
  // mutations: {
  //   changeCount(state,option){
  //     state.count += option
  //   }
  // },
  // actions: {
  //   changeCountAsync({commit},option){
  //     setTimeout(() => {
  //       commit('changeCount',option)
  //     }, 1000);
  //   }
  // },
  getters:{
    // 相当与 vuex的计算属性
    type(state){
      return state.count%2 ? "奇数" :"偶数"
    }
  },
  state,
  mutations,
  actions,
  modules: {
    aaa:A
  }
})
